import { IsNotEmpty, IsOptional } from 'class-validator';
import { Type } from 'class-transformer';

export class createTypesDto {
  @IsNotEmpty({ message: '房屋类型不能为空' })
  readonly name: string;

  @IsOptional()
  readonly desc: string;
}

export class updateTypesDto {
  @IsNotEmpty({ message: '类型id不能为空' })
  @Type(() => Number)
  readonly id: number;

  @IsNotEmpty({ message: '房屋类型不能为空' })
  readonly name: string;

  @IsOptional()
  readonly desc: string;
}

export class deleteTypesDto {
  @IsNotEmpty()
  @Type(() => Number)
  readonly id: number;
}
